/**
 * 打开一个居中的模式对话框
 */
function showCenterModalDialog(URL,dlgWidth,dlgHeight,arg){
    var dlgLeft = (window.screen.width-dlgWidth)/2;
    var dlgTop  = (window.screen.height-dlgHeight)/2;
    var widthTmp = dlgWidth - 80;
    var form    = "scroll:no;status:no;dialogHeight:" + dlgHeight + "px;dialogWidth:" + widthTmp + "px;dialogLeft:" + dlgLeft + ";dialogTop:" + dlgTop;
    return window.showModalDialog(URL,arg,form);
}

/**
 * 打开一个居中的非模式对话框
 */
function showCenterModelessDialog(URL,dlgWidth,dlgHeight,arg){
    var dlgLeft = (window.screen.width-dlgWidth)/2;
    var dlgTop  = (window.screen.height-dlgHeight)/2;
    var widthTmp = dlgWidth - 80;
    var form    = "scroll:no;status:no;dialogHeight:" + dlgHeight + "px;dialogWidth:" + widthTmp + "px;dialogLeft:" + dlgLeft + ";dialogTop:" + dlgTop;
    return window.showModelessDialog(URL,arg,form);
}

/**
 * 打开一个新的窗口
 */
function openWin(URL,dlgWidth,dlgHeight){
    var dlgLeft = (window.screen.width-dlgWidth)/2;
    var dlgTop  = (window.screen.height-dlgHeight)/2;
    var widthTmp = dlgWidth - 80;
    //var form    = "scroll:no;status:no;dialogHeight:" + dlgHeight + "px;dialogWidth:" + widthTmp + "px;dialogLeft:" + dlgLeft + ";dialogTop:" + dlgTop;
    var form = "scrollbars=no;status=no;height=" + dlgHeight + ";width=" + widthTmp + ";left=" + dlgLeft + ";top=" + dlgTop;
    
    return window.open(URL, null, form);
}
function openCenterWindow(URL,wndWidth,wndHeight){
	var wndLeft = (window.screen.width-wndWidth)/2;
	var wndTop  = (window.screen.height-wndHeight)/2;
	var form    = "width=" + wndWidth + ",height=" + wndHeight + ",left=" + wndLeft + ",top=" + wndTop + ",resizable=yes";
	 return window.open(URL,'',form);        
}
